package Tank1;

import java.awt.*;

public class Tank {
	
	protected int x = 100;
	protected int y = 100;
	
	private int w = 50;
	private int h =50;
	
	protected int speed = 10;
	
	private Image image = Toolkit.getDefaultToolkit().getImage("src\\images\\tankD_red.gif");
	
	public Tank(){
		
	}
	public Tank(int x,int y){
		this.x = x;
		this.y = y;
	}
	public Tank(int x,int y,int w,int h,int speed,Image image){
		this.x = x;
		this.y = y;
		this.w = w;
		this.h = h;
		this.speed = speed;
		this.image = image;
	}
	static int l ,t;
	public void move2(){
		if(x < 0){
			x += speed;
			l = 1;
		}else if(y < 0){
			y += speed;
			t = 1;
		}else if(x > 800){
			x -= speed;
			l = 0;
		}else if(y > 600){
			y -= speed;
			t = 0;
		}
		
	}
	public void move(){
		x += speed;
		y += speed;
		
	}
	
	
	public void paint(Graphics g){
		g.drawImage(image,x,y,null);
	}
}
